home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
FNTPAK32.ZIP
/
PASCAL.EXE
/
DEMOBRIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-08-16
|
6KB
|
201 lines
{*************************************************************************
DemoBrit.PAS Copyright 1994 Rob W. Smetana
Demonstrate using all procedures in Video.Obj:
1. GetMonitor Determine monitor types, especially if EGA/VGA.
2. BrightBG Switch between blinking foreground colors and
bright background colors.
3. DefaultPalette Another way to achieve bright background colors,
but without giving up blinking colors.
4. DarkBlue A subset of DefaultPalette, lets you select
dark blue backgrounds -- and leave all other
colors and blinking intact.
Also demonstrate using Font_Dec.Pas to declare all Font Pak routines --
except callable OBJ fonts.
IMPORTANT: Assembler routines in Video.Obj REQUIRE that parameters
be passed by value -- not by reference.
Also, all parameters MUST be integers.
*************************************************************************}
uses CRT, Font_Pak; {Font_Pak.Pas declares/links everything}
Var
Ch : Char;
On_or_Off, WhichPalette, Char: Integer;
FG, BG, BaseValue, Row, WhichMonitor: Integer;
Procedure Is_it_EGA_or_VGA;
{************************************ Demonstrate GetMonitor }
{ Bail out if EGA or VGA not found}
Begin
TextAttr := 23; ClrScr;
fpInitialize; ClrScr; { useful for shareware versions only }
Write (' GetMonitor reports you have ');
WhichMonitor := GetMonitor;
{ bail out if there's no EGA or VGA }
case WhichMonitor of
0, 4, 5: { 0=No monitor, 4 = CGA, 5 = Monochrome }
Begin
ClrScr;
WriteLn(' This demo requires an EGA or VGA monitor. Sorry, I have to end.');
halt;
end;
3: Write ('an EGA');
7,8: Write ('a VGA');
end; {case}
Write (' monitor. OK to proceed. Press <SPACE>.');
Ch := ReadKey;
End;
Procedure DisplayChars;
Begin
FG := 0; {start with black foreground color}
Char := 65;
For BG := 0 to 7 do
Begin
gotoxy(15,Row);
TextBackground (BG);
For FG := 0 to 15 do
begin
TextColor (BaseValue + FG);
Write (' ',Chr(Char),' ');
Inc (Char);
end;
Inc (Row);
End;
TextAttr := 23;
End;
Begin
{************************************ Demonstrate bright backgrounds }
Is_it_EGA_or_VGA; {should we be here at all? }
ClrScr; TextColor (14);
Write (' Demonstrate BrightBG (bright backgrounds). Press <SPACE>.');
Ch := ReadKey;
BaseValue := 0; {start with NON-blinking colors}
Row := 4; DisplayChars;
BaseValue := 16; {now use BLINKING colors }
Row := 15; DisplayChars;
TextAttr := 112;
gotoxy(1,25); ClrEOL;
Write (' Press <SPACE> to turn blinking colors into BRIGHT BACKGROUND colors.');
Ch := ReadKey;
{ call BrightBG, switching from blinking to bright backgrounds }
On_or_Off := 1; {use any non-zero integer value}
BrightBG (On_or_Off);
gotoxy(1,25); ClrEOL;
Write (' Press <SPACE> to restore BLINKING COLORS.');
Ch := ReadKey;
On_or_Off := 0; {0 restores blinking }
BrightBG (On_or_Off);
gotoxy(1,25); ClrEOL;
Write (' And back to normal.');
Ch := ReadKey;
{************************************ Demonstrate changing the PALETTE }
TextAttr := 23; ClrScr; TextColor(14);
Write (' Demonstrate DefaultPalette (Palette Changing). Press <SPACE>.');
Ch := ReadKey;
BaseValue := 0; {start with NON-blinking colors}
Row := 4; DisplayChars;
BaseValue := 16; {now use BLINKING colors }
Row := 15; DisplayChars;
TextAttr := 112;
gotoxy(1,25); ClrEOL;
Write (' Press <SPACE> to turn blinking colors into BRIGHT BACKGROUND colors.');
Ch := ReadKey;
{ call DefaultPalette, switching from blinking to bright backgrounds }
On_or_Off := 2; {2 = use high intensity palette}
DefaultPalette (On_or_Off);
gotoxy(1,25); ClrEOL;
Write (' Notice BOTH blinking AND bright backgrounds. Press <SPACE>.');
Ch := ReadKey;
On_or_Off := 1; {1 = use low intensity palette}
DefaultPalette (On_or_Off);
gotoxy(1,25); ClrEOL;
Write (' Here''s LOW intensity with blinking backgrounds. Press <SPACE>.');
Ch := ReadKey;
On_or_Off := 0; {0 = restore the default palette}
DefaultPalette (On_or_Off);
gotoxy(1,25); ClrEOL;
Write (' And back to normal.');
Ch := ReadKey;
{************************************ Demonstrate Dark Blue backgrounds}
TextAttr := 23; ClrScr; TextColor (14);
Write (' Demonstrate DarkBlue (Change 1 palette only). Press <SPACE>.');
Ch := ReadKey;
BaseValue := 0; {start with NON-blinking colors}
Row := 4; DisplayChars;
BaseValue := 16; {now use BLINKING colors }
Row := 15; DisplayChars;
TextAttr := 112;
gotoxy(1,25); ClrEOL;gotoxy(15,25);
Write ('Press <SPACE> to turn the background into DARK BLUE.');
Ch := ReadKey;
{ call DarkBlue }
DarkBlue;
gotoxy(1,25); ClrEOL;gotoxy(33,25);
Write ('Press <SPACE>.');
Ch := ReadKey;
On_or_Off := 0; {0 = restore the default palette}
DefaultPalette (On_or_Off);
gotoxy(1,25); ClrEOL;gotoxy(30,25);
Write ('And back to normal.');
Ch := ReadKey;
End.